<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Strict//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<head>
<meta charset="utf-8">
<title>layui.form小例子</title>
<link rel="stylesheet" href="../layui/layui/css/layui.css" media="all">
<script src="../layui/layui/layui.js"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
	<div class="layui-header">
		<div class="layui-logo">layui 后台布局</div>
		<!-- 头部区域（可配合layui已有的水平导航） -->
	

</div>
		<!-- 内容主体区域 -->
	<form class="layui-form" action="公司信息.html">
		<div class="layui-form-item">
			<label class="layui-form-label">种类名称</label>
			<div class="layui-input-block">
				<input type="text" name="name" placeholder="请输入公司名称"
					autocomplete="off" class="layui-input">
			</div>
		</div>
		
		<div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="sub">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
     
  </div>
 </form>
	</div>
	

	<div class="layui-footer">
		<!-- 底部固定区域 -->
	
	</div>
</div>
<script src="../layui/layui/layui.js"></script>
<script>
	//JavaScript代码区域

	layui.use([ 'form', 'table','layer' ], function() {
		var form = layui.form;
		var table = layui.table;
		var layer = layui.layer;
		var $ = layui.$;

		//submit提交事件
		form.on('submit(sub)', function(data) {
			console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}

			$.ajax({
				url : "../zhlad",
				type : "get",
				data : data.field,
				success : function(qwe) {

					layer.msg(qwe.msg);

				},

			});

			return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
		});

	})
</script>


</body>

</html>